package cn.jbolt.core.util;
/**
 * JBolt内置颜色
 * @ClassName:  JBoltColorUtil
 * @author: JFinal学院-小木 QQ：909854136
 * @date:   2022年3月22日
 */
public class JBoltColorUtil {
	private static final String[] COLOR_CLASS = { "primary", "success", "info", "danger", "warning", "secondary" };

	public static String colorClassByLevel(int level) {
		if (level < 1 || level > 6) {
			return "primary";
		}

		return COLOR_CLASS[level - 1];
	}

	private static final String[] COLOR_CLASS_PRIORITY_LEVEL = { "priorityLevel_1", "priorityLevel_2", "priorityLevel_3",
			"priorityLevel_4", "priorityLevel_5", "priorityLevel_6" };

	public static String colorClassByPriorityLevel(int level) {
		if (level < 1 || level > 6) {
			return "primary";
		}
		return COLOR_CLASS_PRIORITY_LEVEL[level - 1];
	}


	private static final String[] COLOR_CLASS_BY_STATE = { "secondary", "info","danger", "success", "warning", "dark"};

	public static String colorClassByState(int state) {
		if (state < 1 || state > 6) {
			return "secondary";
		}

		return COLOR_CLASS_BY_STATE[state-1];
	}

	public static String colorClassByServiceState(int state) {
		if (state < 1 || state > 6) {
			return "secondary";
		}

		return COLOR_CLASS_BY_STATE[state-1];
	}
}
